﻿using LY.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LY.DataAccess.Repository
{
    public class CompanyAnnexRepository : BaseRepository
    {
        //根据会员ID查询公司附件信息
        public U_CompanyAnnex GetCompanyAnnex(int memberId, int companyid)
        {
            string sql = @"SELECT [CompanyId]
                          ,[MemberId]
                          ,[Business]
                          ,[Taxation]
                          ,[Institutional]
                          ,[CorporateImg]
                          ,[Verification]
                          ,[Synopsis]
                          ,[Constitution]
                          ,[Reason]
                          ,[Status]
                      FROM [U_CompanyAnnex] where MemberId=@MemberId and CompanyId=@CompanyId";
            return base.Get<U_CompanyAnnex>(sql, new { MemberId = memberId, CompanyId = companyid });
        }

        //根据公司ID查询公司附件信息
        public U_CompanyAnnex GetCompanyAnnex(int companyid)
        {
            string sql = @"SELECT [Id]
                          ,[CompanyId]
                          ,[MemberId]
                          ,[Business]
                          ,[Taxation]
                          ,[Institutional]
                          ,[CorporateImg]
                          ,[Verification]
                          ,[Synopsis]
                          ,[Constitution]
                          ,[Reason]
                          ,[Status]
                      FROM [U_CompanyAnnex] where CompanyId=@CompanyId";
            return base.Get<U_CompanyAnnex>(sql, new { CompanyId = companyid });
        }

        //修改附件信息
       /* public int UpdateCompanyAnnex(String sign, int companyid)
        {
            string sql = "update U_CompanyAnnex set @TuPian='' where CompanyId=@CompanyId";
            return base.Excute(sql, new { TuPian = sign, CompanyId = companyid });
        }*/
    }
}
